package com.time.admin.common.enums;

import lombok.Getter;

/**
 * 评论类别枚举类
 *
 * @author: HuangQi
 * @date: Created in 11:21 2025/11/3
 * @description: 评论类别枚举
 */
@Getter
public enum CommentTypeEnum {

    POST_COMMENT(1, "文章评论"),
    MESSAGE_COMMENT(2, "留言评论");

    private int code;
    private String desc;

    CommentTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static CommentTypeEnum fromCode(int codeVal) {
        for (CommentTypeEnum commentTypeEnum : values()) {
            if (commentTypeEnum.code == codeVal) {
                return commentTypeEnum;
            }
        }
        return null;
    }

}
